﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Text;
using System.Collections.Generic;

public partial class Controls_News : System.Web.UI.UserControl
{
    private string _newshtml;
    public string NewsHtml
    {
        set { _newshtml = value; }
        get { return _newshtml; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Init_News();
    }
    private void Init_News()
    {
        StringBuilder Sb=new StringBuilder();
        List<Model.NEWS> newslist = new List<Model.NEWS>();
        newslist = new BLL.NEWS().GetList(ConfigurationManager.AppSettings["SL"]);
        Sb.Append("<ul>");
        Sb.Append("<li>");
        Sb.Append("<a href=\"News/UpDownInfo.aspx\" title=\"商品上下架信息\">");
        Sb.Append("商品上下架信息");
        Sb.Append("</a></li>");
        foreach (Model.NEWS news in newslist)
        {
            Sb.Append("<li>");
            Sb.Append("<a href=\"News/New_"+news.NEW_ID+".html\" title=\"" + news.NEW_TITLE + "\">");
            Sb.Append(BasePage.GetSubstring(news.NEW_TITLE,1,13));
            Sb.Append("</a></li>");
        }
        Sb.Append("</ul>");
        NewsHtml = Sb.ToString();
    }

}
